<?php
/**
 * 邮件日志模型
 */

namespace app\common\model;

use think\model\concern\SoftDelete;

class EmailLog extends Model
{
    use SoftDelete;
    public $softDelete = true;
    protected $name = 'email_log';
    protected $autoWriteTimestamp = false;
    const S_TEXT = [0 => '失败', 1 => '成功'];
    //可搜索字段
    public $whereField = ['staff_id','department_id','salary_time'];
//状态0发送失败1发送成功获取器
    public function getStatusTextAttr($value, $data)
    {
        return self::S_TEXT[$data['status']];
    }
//工资日期获取器

// public function getSalaryTimeAttr($value)
// {
//     return date('Y-m', $value);
// }

//工资日期修改器
//    public function setSalaryTimeAttr($value)
//    {
//        return strtotime($value);
//    }

    public function getSalaryEmailContentAttr($value)
    {
        return str_replace("<br>","; ",$value);
    }



}
